﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThreeObject.ERP.DTO;
using ThreeObject.ERP.Model.Wang;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace ThreeObject.ERP.Wang
{
    /// <summary>
    /// 智慧管理services
    /// </summary>
    public class PositionManagementServices: ApplicationService, IPositionManagementServices
    {
        /// <summary>
        /// 职位管理仓储
        /// </summary>
       public readonly IRepository<JobGradeManagementModel, int> _jobGradeManagementModel;

        public PositionManagementServices(IRepository<JobGradeManagementModel, int> jobGradeManagementModel)
        {
            _jobGradeManagementModel = jobGradeManagementModel;
        }

        /// <summary>
        /// 添加职位管理
        /// </summary>
        /// <param name="jobGradeManagementModel"></param>
        /// <returns></returns>
        public  async Task<JobGradeManagementModel> AddJobGradeManagementModel(JobGradeManagementModelDTO jobGradeManagementModel)
        {
            var jobGradeManagement=  ObjectMapper.Map<JobGradeManagementModelDTO, JobGradeManagementModel>(jobGradeManagementModel);
            var jobGradeManagemen =  await _jobGradeManagementModel.InsertAsync(jobGradeManagement);
            return jobGradeManagemen;
        }

        /// <summary>
        /// 显示职位信息
        /// </summary>
        /// <returns></returns>
        public async Task<List<JobGradeManagementModel>> QueryJobGradeManagement(QueryJobGradeManagementDTO queryJobGradeManagementDTO) 
        {
            var jobGradeManagementModels =await _jobGradeManagementModel.GetListAsync();
            return jobGradeManagementModels;

        }


    }
}
